package features.advance.jdk.dynamicproxy.jdk;

import sun.reflect.Reflection;

/**
 * @author LIN
 * @date 2021-04-26
 */
public class Main {
    public void a(){
        class a{
            public void sayHello(){
                System.out.println(this.getClass());
                class b extends a{
                    void test01(){
                        System.out.println(Thread.currentThread().getName());
                    }
                }
                new b().test01();
            }
            class b{

            }
        }
        a a = new a();
        a.sayHello();
    }
    public static void main(String[] args) {
        JdkProxy jdkProxy = new JdkProxy();
        TargetClass targetClass = new TargetClassImpl();
        TargetClass proxy = (TargetClass) jdkProxy.createProxy(targetClass);
        proxy.sayHello();
        proxy.write();
        System.out.println(Reflection.getCallerClass());
        new Main().a();
    }
}
